package cn.com.controller;

import cn.com.po.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import cn.com.service.UserService;

/**
 * @author CRL
 * @date 2021/4/10 10:50
 */
@RestController
@Slf4j
@RequestMapping("/api/v1")
public class TestController {

    @Autowired
    UserService userService;

    @GetMapping
    public String test() {
        return "1";
    }

    @PostMapping
    public boolean save(@RequestBody(required = false) User requestDto) {
        boolean save = userService.save(requestDto);
        return save;
    }

}
